﻿using HZH_Controls.Controls;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using 渐变.admin_Form;
using 渐变.user_Form;

namespace 渐变
{
    public partial class Form1 : Form
    {
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
                case 0x84:
                    base.WndProc(ref m);
                    if ((int)m.Result == 0x1)
                        m.Result = (IntPtr)0x2;
                    return;
            }

            base.WndProc(ref m);
        }

        public const int WM_NCLBUTTONDOWN = 0xA1;
        public const int HT_CAPTION = 0x2;

        [System.Runtime.InteropServices.DllImport("user32.dll")]
        public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
        [System.Runtime.InteropServices.DllImport("user32.dll")]
        public static extern bool ReleaseCapture();

       
        public Form1()
        {
            InitializeComponent();
        }

      
   


  
      

        private void bunifuFlatButton1_Click(object sender, EventArgs e)
        {
            //Userpanel.Visible = false;
          /*  HomePanel.Visible = true;
            HomePanel.Refresh();*/
        }



 
        /*打开汽车管理界面*/
        private void btnCarManager_Click(object sender, EventArgs e)
        {
            /*CarManager carManager = new CarManager();
            carManager.MdiParent = this;
            carManager.Show();*/
            admin_carManager carManager = new admin_carManager();
            carManager.MdiParent = this;
            carManager.Show();
        }


        private void btnType_Click(object sender, EventArgs e)
        {
            carTypeManager typeManager = new carTypeManager();
            typeManager.MdiParent = this;
            typeManager.Show();
        }

        private void bunifuFlatButton1_Click_1(object sender, EventArgs e)
        {
            /* welcomeForm welcomeForm = new welcomeForm();
             welcomeForm.MdiParent = this;
             welcomeForm.Show();*/
            user_welcome welcome = new user_welcome();
            welcome.MdiParent = this;
            welcome.Show();
        }

        /*汽车管理页面 start*/
        private void userManager_Click(object sender, EventArgs e)
        {
            /* userManager user = new userManager();
             user.MdiParent = this;
             user.Show();*/
            admin_userManager userManager = new admin_userManager();
            userManager.MdiParent = this;
            userManager.Show();
        }
        /*汽车管理页面 end*/

        private void timer1_Tick(object sender, EventArgs e)
        {
            toolStripStatusLabel2.Text = "系统时间：" + DateTime.Now.ToLongTimeString();
        }
                                                                                                                                                  
        private void Form1_Load_1(object sender, EventArgs e)
        {
            Admin admin = new Admin();
            admin = (Admin)this.Tag;
            toolStripStatusLabel1.Text = "欢迎：" + admin.superName;

            /* welcomeForm welcomeForm = new welcomeForm();
             welcomeForm.MdiParent = this;
             welcomeForm.Show();*/
            user_welcome welcome = new user_welcome();
            welcome.MdiParent = this;
            welcome.Show();
        }


        /*修改密码 start*/
        private void btnEditPwd_Click_1(object sender, EventArgs e)
        {
            Admin admin = new Admin();
            admin = (Admin)this.Tag;

            PerCenterForm perCenter = new PerCenterForm();
            perCenter.MdiParent = this;
            perCenter.Value = admin.superPassword;
            perCenter.NameValue = admin.superName;
            perCenter.Show();
        }
        /*修改密码 end*/


        private void btnEnv_Click(object sender, EventArgs e)
        {
            sysForm sys = new sysForm();
            sys.MdiParent = this;
            sys.Show();
        }

        private void btnNotice_Click(object sender, EventArgs e)
        {
            Admin admin = new Admin();
            admin = (Admin)this.Tag;
           admin_notice notice = new admin_notice();
            notice.NameValue = admin.superName;
            notice.MdiParent = this;
            notice.Show();
        }

        /*数据分析 start*/
        private void btnAnalysis_Click(object sender, EventArgs e)
        {
            admin_sales sales = new admin_sales();
            sales.MdiParent = this;
            sales.Dock =  DockStyle.Fill;
            sales.Show();
        }
        /*数据分析 end*/

        //关闭窗口
        private void btnClose_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        //最小化窗口
        private void btnMin_Click(object sender, EventArgs e)
        {
            WindowState = FormWindowState.Minimized;
        }

        private void btnLog_Click(object sender, EventArgs e)
        {
            admin_logFrm logFrm = new admin_logFrm();
            logFrm.MdiParent = this;
            logFrm.Show();

        }

        private void btnCheck_Click(object sender, EventArgs e)
        {
            admin_checkCar checkCar = new admin_checkCar();
            checkCar.MdiParent = this;
            checkCar.Show();
        }

        private void btntousu_Click(object sender, EventArgs e)
        {
            admin_complaintFrm complaintFrm = new admin_complaintFrm();
            complaintFrm.MdiParent = this;
            complaintFrm.Show();
        }
    }
}
